#pragma once

#include "log4cplus/logger.h"

#define LOG_ERROR(iErrorMessage) ZeEngine::Logger::getInstance()->logError      (typeid(*this).name(), __FUNCTION__, iErrorMessage); assert(false);
#define LOG_INFORMATION(iInfoMessage) ZeEngine::Logger::getInstance()->logInformation(typeid(*this).name(), __FUNCTION__, iInfoMessage);
#define LOG_WARNING(iWarningMessage) ZeEngine::Logger::getInstance()->logWarning    (typeid(*this).name(), __FUNCTION__, iWarningMessage); assert(false);

namespace ZeEngine
{    
    class Logger
    {
    public:
        static Logger* getInstance();

        ~Logger(){}

        void logError(const log4cplus::tstring& iClassName, const log4cplus::tstring& iFunctionName, const log4cplus::tstring& iMessage);
        void logInformation(const log4cplus::tstring& iClassName, const log4cplus::tstring& iFunctionName, const log4cplus::tstring& iMessage);
        void logWarning(const log4cplus::tstring& iClassName, const log4cplus::tstring& iFunctionName, const log4cplus::tstring& iMessage);

        void logError(const log4cplus::tstring& iMessage);
        void logInformation(const log4cplus::tstring& iMessage);
        void logWarning(const log4cplus::tstring& iMessage);

    private:
        //Create a Singleton
        static bool                 m_InstanceFlag;
        static Logger*              m_Instance;
        Logger(){}

        static log4cplus::Logger    m_Logger;

        void initializeLogger();
    };
}